package com.huahan.auth.api;

import com.huahan.auth.exception.DefaultErrorDecoder;
import feign.Feign;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class ApiConfiguration {
  @Value("${OAuth2.Apiurl}")
  private String OAuth2ApiUrl ;
  @Bean
  public OAuth2Api oAuth2Api() {
    return Feign.builder()
        .errorDecoder(new DefaultErrorDecoder())
        .target(OAuth2Api.class, OAuth2ApiUrl);
  }
}
